﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tool;

namespace AutoMachine
{
    public partial class Frm_Config : Form
    {
        Tool.AutoResize FormResize = new Tool.AutoResize();//窗体缩放实例化
        public Frm_Config()
        {
            InitializeComponent();
           
        }

        #region 窗体实例化
        /// <summary>
        /// 窗体对象实例化
        /// </summary>
        private static Frm_Config _instance;
        public static Frm_Config Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new Frm_Config();
                return _instance;
            }
        }
        #endregion

        private void Frm_Config_Load(object sender, EventArgs e)
        {
            FormResize.SetAutoResize(this);//窗体缩放实例化
            SysConfig.ReadIniToDGV(this.dgvConfig);
        }

        //数据刷新
        private void roundButton1_Click(object sender, EventArgs e)
        {
            SysConfig.ReadIniToDGV(this.dgvConfig);
        }
        //数据保存
        private void roundButton2_Click(object sender, EventArgs e)
        {
            SysConfig.WriteDgvToIni(this.dgvConfig);
            SysConfig.WriteIniToSystem();
        }
        //数据下载
        private void roundButton3_Click(object sender, EventArgs e)
        {

        }
    }
}
